﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace NObsidian.Containers
{
    [DataContract(Name = "character")]
    public class Character : ContainerBase
    {
        [DataMember(Name = "campaign_id", EmitDefaultValue=false)]
        public string CampaignId { get; set; }

        [DataMember(Name = "tagline", EmitDefaultValue = false)]
        public string TagLine { get; set; }

        [DataMember(Name = "dynamic_sheet_template", EmitDefaultValue = false)]
        public DynamicSheetTemplate Template { get; set; }

        [DataMember(Name = "dynamic_sheet", EmitDefaultValue = false)]
        public string DynamicSheet { get; set; }

        [DataMember(Name = "description", EmitDefaultValue = false)]
        public string Description { get; set; }

        [DataMember(Name = "description_html", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public string DescriptionHtml { get; set; }

        [DataMember(Name = "bio", EmitDefaultValue = false)]
        public string Bio { get; set; }

        [DataMember(Name = "bio_html", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public string Bio_Html { get; set; }

        [DataMember(Name = "game_master_info", EmitDefaultValue = false)]
        public string GameMasterInfo { get; set; }

        // TODO in documentation appears as game_master_info_markup 
        [DataMember(Name = "game_master_info_html", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public string GameMasterInfoHtml { get; set; }

        // Character summary
        [DataMember(Name = "character_url", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public string CharacterURL { get; set; }

        [DataMember(Name = "campaign", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public Campaign Campaign { get; set; }

        [DataMember(Name = "visibility", EmitDefaultValue = false)]
        public string Visibility { get; set; }

        [DataMember(Name = "author", EmitDefaultValue = false)]
        public User Author { get; set; }

        [DataMember(Name = "author_id", EmitDefaultValue = false)]
        public string AuthorId { get; set; }

        [DataMember(Name = "is_player_character", EmitDefaultValue = false)]
        public string IsPlayerCharacter { get; set; }

        [DataMember(Name = "tags", EmitDefaultValue = false)]
        public List<string> Tags { get; set; }

        [DataMember(Name = "is_game_master_only", EmitDefaultValue = false)]
        public bool IsGameMasterOnly { get; set; }

        [DataMember(Name = "avatar_url", EmitDefaultValue = false)]
        [ObsidianReadOnly]
        public string AvatarURL { get; set; }
    }

    [DataContract]
    public class DynamicSheetTemplate
    {
        [DataMember(Name = "id")]
        public string Id { get; set; }

        [DataMember(Name = "name")]
        public string Name { get; set; }

        [DataMember(Name = "slug")]
        public string Slug { get; set; }
    }
}
